# -*- coding: utf-8 -*-
# @Time    : 2024/9/6 下午2:08
# @Author  : liujun
# @Email   : 2592730854@qq.com
# @File    : release_page.py
# @Software: PyCharm



from appium.webdriver.common.appiumby import AppiumBy as By
class ReleasePage:
    """发布页面"""

    # 上传菜谱按钮
    release_upload_recipe_locator=(By.XPATH,"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.ImageView")

    #上传作品
    release_upload_works_locator=(By.XPATH,"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.ImageView")

    #记饮食
    release_record_diet_locator=(By.XPATH,"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[3]/android.widget.ImageView")


    def __init__(self,driver):
        self.driver = driver

    def click_release_upload_recipe(self):  #点击上传视频按钮
        self.driver.find_element(*self.release_upload_recipe_locator).click()

    def click_release_upload_works(self):  #点击上传作品
        self.driver.find_element(*self.release_upload_works_locator).click()

    def click_release_record_diet(self):  #点击记饮食
        self.driver.find_element(*self.release_record_diet_locator).click()